package gateway

import (
	"fmt"
	"log"
	"net"
	"plato/common/config"
)

func RunMain(path string) {
	config.Init(path)
	ln, err := net.ListenIP("tcp", &net.TCPAddr{Port: config.GetGatewayServerPort()})
	if err != nil {
		log.Fatalf("Start TCP Epoll server error: %s", err.Error())
		panic(err)
	}
	initWorkPoll()
	initEpoll(ln, runProc)
	fmt.Println("-----------------imgateway statr-----------------")
	select {}
}
